package com.example.mybatis.plus.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.example.mybatis.plus.model.UserInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface UserInfoMapper extends BaseMapper<UserInfo> {
    //自定义SQL
    //@Select("select id,username,password,age from user_info where username=#{name}")
    @Select("select id,username,password,age from user_info ${ew.customSqlSegment}")
    List<UserInfo> selectByCustom(@Param(Constants.WRAPPER)Wrapper wrapper);

    List<UserInfo> selectByCustom2(@Param(Constants.WRAPPER)Wrapper wapper);
}
